
#ifdef DATABASE_EXPORTS
#define DATABASE_API __declspec(dllexport)
#else
#define DATABASE_API __declspec(dllimport)
#endif

#ifndef __DATABASE_H
#define __DATABASE_H

#include <comdef.h>

typedef struct {
	long ticks;
	int hour;
	int minutes;
	int seconds;
	int month;
	int day;
	int year;
	char *comment;
} DATETIME;

class DATABASE_API CResource
{
public:
  CResource(const char* pszConnstr);
  virtual ~CResource();
  virtual void setInUse(bool bInUse);
  virtual bool getInUse();
  virtual void * getConnection() = 0;
  virtual	_variant_t getConnectionVariant() = 0;

  bool operator==(CResource& other);
protected:
	DATETIME m_lastUsed;
	bool m_currentlyUsed;
	GUID m_id;
};

class DATABASE_API CPool
{
public:
  CPool();
  virtual ~CPool();
  virtual CResource* aquire() = 0;
  virtual void release(CResource* res) = 0;
protected:
  long m_initSize;
  char * m_pszConnStr;
};

class DATABASE_API CPoolFactory
{
public:
  virtual CPool* getPool() = 0;
};

#endif
